﻿using DotNetty.Framework;
using DotNetty.Framework.BaseModel;
using System.Threading.Tasks;

namespace iTool.Connector.HttpWorkers
{
    public class HeartbeatWorker : IHttpWorker
    {

        public int SecondOfTimeOut { get; set; } = 10;

        public Task DoWorking<THttpContext>(THttpContext context) where THttpContext : AbstractHttpContext, new()
        {
            context.ResponseBody = "Ok";
            return Task.CompletedTask;
        }

        public bool IsUseWorking<THttpContext>(THttpContext context) where THttpContext : AbstractHttpContext, new()
        {
            return context.Path == "/heartbeat";
        }

    }
}
